'''
秒表

import time

print("按下回车开始计时，中断则停止计时")
input("输入任意字符回车开始")
start = time.time()
print("开始计时")
try:
    while True:
      elapsed = time.time() - start
      print(f"\r计时：{elapsed:.0f}秒", end="")
      time.sleep(1)
except KeyboardInterrupt:
    end = time.time()
    print(f"\n一共{round(end - start, 2)}秒")
'''
from calendar import month

'''
实现猜数字游戏并测试反应速度
会生成0-99的一个数字供用户猜测，并实时反馈引导用户猜中
会记录耗时，并提供反馈

import time
import random

ans = random.randint(0,99)
start = time.time()
for i in range(100):
 try:
    num = int (input("请输入答案："))
 except ValueError:
    print("输入错误")
    continue
    if num > ans:
      print("猜大了，再试一次吧")
    elif num < ans:
      print("猜小了，加油吧")
    else:
      print("回答正确")
      end = time.time()
      print(f"一共{round(end - start, 2)}秒")
      break
'''

'''
解析给定的日期字符串，并打印出日期时间

from dateutil import parser
date_string = "Aug 28 2025 8:00AM"

parsered_date = parser.parse(date_string)
print(parsered_date)
'''

'''
用户输入年份和月份，并打印该月份对应的日历

import calendar

year = int(input("请输入年份："))
mouth = int(input("请输入月份："))

print(calendar.month(year, mouth))
'''

'''
计算并打印出指定年月第一天是星期几以及该月份的总天数


import calendar

year = int(input("请输入年份："))
mouth = int(input("请输入月份："))

first_day , numday = calendar.monthrange(year, mouth)

# 获取月份第一天是星期几以及总天数
weekday = ["星期一","星期二","星期三","星期四","星期五","星期六","星期日"]
print(f"{year}年{mouth}月的第一天是{weekday[first_day]}, 该月份一共有{numday}天")
'''